home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Creative Review 30
/
Creative-Review-CD-ROM-30.iso
/
mac
/
More
/
Simon Tyszko
/
atomic
/
00002_Script_ball
< prev
next >
Wrap
Text File
|
1997-10-01
|
3KB
|
127 lines
property psprite, phinc, pvinc, pspeed,pmyproximity,pmyvolume,phdist,pvdist
property pheight
property pwidth
property ptrack
property psizevalue
property pcaststartnum
property prandomfactor
property pnumofcasts
property prolloverflag
on birth me, asprite, caststartnum, numofcasts
set pnumofcasts = numofcasts-1
set psprite = asprite
set pcaststartnum = caststartnum
set the puppet of sprite psprite = true
set pspeed = random(7)
set pheight = the height of sprite psprite
set pwidth = the width of sprite psprite
set the loch of sprite psprite = random(640)
set the locv of sprite psprite = random(480)
set ptrack = psprite
return me
end
---------------------------------------
---------------------------------------
on move me, hinc, vinc
set phinc = hinc
set pvinc = vinc
----moves the sprites
set the loch of sprite psprite ¼
= the loch of sprite psprite + (phinc/pspeed)
set the locv of sprite psprite ¼
= the locv of sprite psprite + (pvinc/pspeed)
if the locv of sprite psprite > the stagebottom + (the height of sprite psprite) then¼
set the locv of sprite psprite = 0-----(the height of sprite psprite)
if the locv of sprite psprite < 0-(the height of sprite psprite/2) then ¼
set the locv of sprite psprite = the stagebottom + (the height of sprite psprite)
if the loch of sprite psprite > the stageright + (the width of sprite psprite) then set the loch¼
of sprite psprite = 0-(the width of sprite psprite)
if the loch of sprite psprite < 0-(the width of sprite psprite) then set the loch¼
of sprite psprite = the stageright + (the width of sprite psprite)
end move
---------------------------------------
---------------------------------------
on makesound me
set channelnumber = ptrack
if rollover(psprite) then
if prolloverflag = false then
puppetsound channelnumber, 161+psprite
set prolloverflag = true
set the volume of sound channelnumber = 128
end if
else
set prolloverflag = false
if the volume of sound channelnumber >0 then fadesounddown
else
sound stop(channelnumber)
end if
end if
end makesound
---------------------------------------
---------------------------------------
on animate me
set the castnum of sprite psprite = the castnum of sprite psprite + 1
if the castnum of sprite psprite > pcaststartnum + pnumofcasts then
set the castnum of sprite psprite = pcaststartnum
end if
end animate
---------------------------------------
---------------------------------------
on adjustsize me
set the height of sprite psprite¼
= (pheight * (pmyvolume/99.001))+2
set the width of sprite psprite¼
= (pwidth * (pmyvolume/99.001))+2
end
---------------------------------------
---------------------------------------
on blend me
set the blend of sprite psprite = (100.001/255)*pmyvolume
end blend
---------------------------------------
on fadesounddown
set the volume of sound ptrack = the volume of sound ptrack -4
end fadesounddown
---------------------------------------